<div class="container" id="ajax_content">
    <?php
        include 'header2.php';
    ?>
    <div class="content">
    	<div class="headcontent">
            <span class="randomtext" style="margin-left:50px">Hi,
            <?php
                global $session;
                $user_id = $session->get('userid');
                $sql="SELECT fullname FROM user WHERE iduser='$user_id'";
		$result=mysql_query($sql);
		while($res = mysql_fetch_array($result)) {
                    $nama = $res['fullname'];
		}
		echo $nama;
            ?>
            </span>
            <span class="randomtext" style="padding-left:760px">MESSAGE DETAIL</span>
        	<hr/>
        </div>
        <div class="singlecontent" style="width:900px">
            <div class="wallpost">
            	<div class="item2">
                	<label>From</label> : <label><?php echo $sender ?></label>
                </div>
                <div class="item2">
                	<label>To</label> : <label><?php echo $receiver ?></label>
                </div>
                <div class="item2">
                	<label>Subject</label> : <label><?php echo $topik ?></label>
                </div>
            </div>
            <div class="wallpost">
                <div class="post">
                    <div class="postitem" style="width: 65px">
                        <div class="fotoitem">
                            <img src="images/pudy.jpg" alt="pudy cantik" height="50" width="50" />
                        </div>
                  	</div>
                    <div class="postitem" style="width: 450px">
                        <label><?php echo $sender?></label><br/>
                        <label><?php echo $isi ?></label><br/>
                        <!--<label>19 Maret 2011</label>-->
                    </div>
                    <div class="postitem">
                        <label>Delete</label>
                    </div>
                    <div class="clearboth"></div>
                </div>
                <?php
                    $query = 'SELECT * FROM komen_msg WHERE idmsg=\''.mysql_real_escape_string($idmsg).'\'';
                    $result = mysql_query($query);
                    while ($res = mysql_fetch_array($result)) {
                        $query2 = 'SELECT fullname FROM user WHERE iduser='.$res['id_writer'].'';
                        $result2 = mysql_query($query2);
                        $res2 = mysql_fetch_array($result2);
                        echo '<div class="post">
                                <div class="postitem" style="width: 65px">
                                    <div class="fotoitem">
                                        <img src="images/pudy.jpg" alt="pudy cantik" height="40" width="40" />
                                    </div>
                                </div>
                                <div class="postitem" style="width: 450px">
                                    <label>'.$res2['fullname'].'</label><br/>
                                    <label>'.$res['isi'].'</label><br/>
                                </div>
                                <div class="postitem">
                                    <label>Delete</label>
                                </div>
                                <div class="clearboth"></div>
                              </div>';
                    }
                ?>
                <div class="post">
                    <form action="<?php echo BASE_PATH;?>mdetail/komenmsg/<?php echo $idmsg ?>" method="post">
                    <!--<form action="<?php echo BASE_PATH . "mdetail/komenmsg" ?>" method="post">-->
                        <div class="post">
                            <textarea rows="2" cols="72" name="post"></textarea>
                        </div>
                        <div>
                            <button type="submit">Post</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="footer"></div>
</div>
</body>
</html>
